package com.py.credit.service.impl;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.py.credit.dao.EvalInfoDao;
import com.py.credit.dao.ModelBaseDao;
import com.py.credit.entity.Cards;
import com.py.credit.entity.EvalInfo;
import com.py.credit.entity.GatewayUserEntity;
import com.py.credit.entity.IndexCatModel;
import com.py.credit.entity.Model;
import com.py.credit.entity.SysMsgDetailEntity;
import com.py.credit.entity.SysMsgEntity;
import com.py.credit.service.CardsService;
import com.py.credit.service.EvalInfoService;
import com.py.credit.service.GatewayAuthenticationService;
import com.py.credit.service.GatewayUserService;
import com.py.credit.service.ModelBaseService;
import com.py.credit.service.MsgService;
import com.py.credit.utils.EmailUtil;
import com.py.credit.utils.FormulaCalculator;
import com.py.credit.utils.NumberUtils;
import com.py.credit.utils.SQLBuilder;
import com.py.credit.utils.UuidUtil;
import com.py.framework.core.common.Page;

@Service
public class EvalInfoServiceImpl implements EvalInfoService {

	@Autowired
	private EvalInfoDao evalInfoDao;

	@Autowired
	private ModelBaseDao modelBaseDao;

	@Autowired
	private CardsService cardsService;

	@Autowired
	private ModelBaseService modelBaseService;

	@Autowired
	private MsgService msgService;

	@Autowired
	private GatewayUserService gatewayUserService;

	@Autowired
	private GatewayAuthenticationService gatewayAuthenticationService;

	@Override
	public List<Model> getListForPage(String sortType, Page page) {

		return evalInfoDao.getListForPage(sortType, page);
	}

	@Override
	public List<Map<String, Object>> getByConditionForPage(List<String> columns, String[] additionalColumns,
			String conditionStr, Page page, String shzt) {
		List<String> conditions = SQLBuilder.createConditionSql(conditionStr);
		List<Map<String, Object>> batchLogs = evalInfoDao.selectByConditionForPage(columns, additionalColumns,
				conditions, page, shzt);

		return batchLogs;
	}

	@Override
	public List<Map> getRelatedCategoryAndIndexValuesByModelId(String userId, String modelId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getRelatedCategoryAndIndexValuesByModelId(userId, modelId);
	}

	@Transactional
	@Override
	public void check(List list, String shr, String oldStatus, String newStatus, String type, String shyj,
			String evalId, String userName, String cardsType, String userId, String Eurl) {
		Date d = new Date();
		Map<String, Object> params = new HashMap<>();
		params.put("id", Long.parseLong(userId));
		GatewayUserEntity gatewayUserEntity = gatewayUserService.getUserByTwoPrincipal(params);
		gatewayAuthenticationService.refreshUserSessionAllToken(gatewayUserEntity);
		String bgbh = evalInfoDao.selectBgbh(evalId);
		if (list.size() > 0 && null != list && !("").equals(list.get(0))) {
			Map<String, Object> model = new HashMap<String, Object>();
			model.put("userType", "企业");
			model.put("reportName", "报告");
			model.put("hello", "很抱歉，");
			model.put("userName", gatewayUserEntity.getUsername());
			model.put("status", "未通过报告审核");
			model.put("url", Eurl);
			EmailUtil.sendHtmlMessageByTemplate(gatewayUserEntity.getDzyx(), "【大数据征信】报告审核", model,
					"reportNoticeTemplate.ftl");
			SysMsgEntity entity = new SysMsgEntity();
			List<SysMsgDetailEntity> detail = new ArrayList<>();
			SysMsgDetailEntity entity1 = new SysMsgDetailEntity();
			detail.add(entity1);
			entity1.setRevieverName(gatewayUserEntity.getUsername());
			entity1.setReviever(gatewayUserEntity.getId());
			entity1.setRevieveType(1);
			entity.setMsgTitle("报告审核通知");
			entity.setMsgContent("【大数据征信平台】您有一个企业信用评价报告已经审核失败，报告编号为" + bgbh + "请至评价历史点击“重新发起”继续申请流程");
			entity.setLinkUrl(Eurl);
			entity.setMsgType(1);
			entity.setDetails(detail);
			msgService.addMsgInfo(entity);
		}

		if (type != null && "1".equals(type)) {
			if ("4".equals(oldStatus)) {
				newStatus = "5";
			} else {
				EvalInfo evalInfo = evalInfoDao.selectOne(evalId);
				String orgId = evalInfo.getOrgId();
				String modelId = evalInfo.getModelId();
				Map<String, String> m = modelBaseDao.selectCheckProcessForOrg(orgId, modelId);
				String checkProcess = m.get("checkProcess");
				if (StringUtils.isBlank(checkProcess)) {
					checkProcess = evalInfoDao.getCheckProcessByModel(modelId);
				}
				int index = Integer.parseInt(oldStatus);
				for (int i = index; i < checkProcess.length(); i++) {
					if (checkProcess.charAt(i) == '1') {
						newStatus = String.valueOf(i + 1);
						break;
					}
				}
			}

		}
		String processId = UuidUtil.getUUid();
		if (newStatus.equals("5")) {
			String[] cardType = cardsType.split(",");
			List<String> cardList = Arrays.asList(cardType);
			if (!cardList.isEmpty()) {
				int size = cardList.size();
				for (int i = 0; i < size; i++) {

					Cards card = cardsService.selectCardsDetail(null, null, cardList.get(i), userId, "2");
					String cardsId = card.getId();
					cardsService.updateCardShzj(cardsId, "1");
					cardsService.updateCardSinStatus(cardsId);
					Long cardsId1 = Long.parseLong(cardsId);
					cardsService.addHistory(userName, "1", cardsId1, shyj, "指标申报中心");

				}
			}
		}
		if (newStatus.equals("3")) {
			EvalInfo evalInfo = evalInfoDao.selectOne(evalId);
			this.preScore(evalInfo.getModelId(), evalInfo.getSqr(), evalId);
		}
		evalInfoDao.changeStatus(newStatus, d, shr, evalId, processId);
		evalInfoDao.evalProcess(processId, oldStatus, newStatus, shr, d, shyj, evalId);
		if (list.size() > 0 && null != list && ("").equals(list.get(0))) {
			evalInfoDao.returnIndexes(list, processId);
		}
		if (newStatus.equals("5")) {
			Map<String, Object> model = new HashMap<String, Object>();
			model.put("userType", "企业");
			model.put("reportName", "报告");
			model.put("hello", "恭喜您！");
			model.put("userName", gatewayUserEntity.getUsername());
			model.put("status", "通过报告审核");
			model.put("url", Eurl);
			EmailUtil.sendHtmlMessageByTemplate(gatewayUserEntity.getDzyx(), "【大数据征信】报告审核", model,
					"reportNoticeTemplate.ftl");
			SysMsgEntity entity = new SysMsgEntity();
			List<SysMsgDetailEntity> detail = new ArrayList<>();
			SysMsgDetailEntity entity1 = new SysMsgDetailEntity();
			detail.add(entity1);
			entity1.setRevieverName(gatewayUserEntity.getUsername());
			entity1.setReviever(gatewayUserEntity.getId());
			entity1.setRevieveType(1);
			entity.setMsgTitle("报告审核通知");
			entity.setMsgContent("您有一个企业信用评价报告已经审核成功，报告编号为" + bgbh + "请至评价历史点击“查看报告”");
			entity.setLinkUrl(Eurl);
			entity.setMsgType(1);
			entity.setDetails(detail);
			msgService.addMsgInfo(entity);
		}
	}

	@Override
	public List<IndexCatModel> getAllIndexAndValuesAndRules(String evalId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getAllIndexAndValuesAndRules(evalId);
	}

	@Override
	public List<IndexCatModel> getAllIndexAndValuesAndRulesForZz(String evalId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getAllIndexAndValuesAndRulesForZz(evalId);
	}

	@Transactional
	@Override
	public void initScoreByIndex(String deleteScoreByIndex, String userId, String value) {
		evalInfoDao.deleteScoreByIndex(deleteScoreByIndex, userId);
		String id = UuidUtil.getUUid();
		evalInfoDao.initScoreByIndex(deleteScoreByIndex, userId, value, id);
	}

	@Override
	public String getModelScoreRank(String modelId, String score) {
		// TODO Auto-generated method stub
		return evalInfoDao.getModelScoreRank(modelId, score);
	}

	@Override
	public EvalInfo getNewEvalInfo(String userId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getNewEvalInfo(userId);
	}

	@Override
	public List<Map> viewCheck(String modelId, String userId, String evalId) {
		// TODO Auto-generated method stub
		return evalInfoDao.viewCheck(modelId, userId, evalId);
	}

	@Override
	public void updateModelIndexValue(String evalId, String indexCatModelId, String userId, String value, String cjr) {
		// TODO Auto-generated method stub
		evalInfoDao.deleteModelIndexValue(evalId, indexCatModelId, userId);
		evalInfoDao.updateModelIndexValue(evalId, indexCatModelId, userId, value, cjr);
	}

	@Transactional
	@Override
	public void updateModelIndexScore(String indexCatModelId, String modelId, String userId, double value,
			String evalId) {
		// TODO Auto-generated method stub
		List<IndexCatModel> listR = new ArrayList<IndexCatModel>();
		IndexCatModel icm = evalInfoDao.getIndexCategoryModelById(indexCatModelId, evalId);
		double scoreOld = icm.getScore();
		icm.setScore(value);
		// icm.setScore2(value);
		listR.add(icm);
		evalInfoDao.deleteModelIndexScore(indexCatModelId, evalId);
		getParentSingleScore(listR, modelId, icm.getpId(), value - scoreOld, icm.getWeight(), evalId);
		evalInfoDao.preScore(listR, userId, modelId, evalId);
	}

	public void getParentSingleScore(List<IndexCatModel> list, String modelId, String indexOrCatId, Double score,
			Double weight, String evalId) {
		IndexCatModel indexCatModel = evalInfoDao.getIndexCategoryModelScore(indexOrCatId, modelId, evalId).get(0);
		evalInfoDao.deleteModelIndexScore(indexCatModel.getId(), evalId);
		score = (score * weight) / 100;
		indexCatModel.setScore(indexCatModel.getScore() + score);
		indexCatModel.setScore2(indexCatModel.getScore2() + score);
		list.add(indexCatModel);
		if (indexCatModel.getpId() == null || "".equals(indexCatModel.getpId()) || "0".equals(indexCatModel.getpId())) {
		} else {
			getParentSingleScore(list, modelId, indexCatModel.getpId(), score, indexCatModel.getWeight(), evalId);
		}
	}

	@Override
	public List<IndexCatModel> getAllListScore(List<IndexCatModel> list, String userId, String modelId) {
		// TODO Auto-generated method stub
		List<IndexCatModel> listR = new ArrayList();
		listR.addAll(list);
		if (list != null && list.size() > 0) {
			for (int i = 0; i < list.size(); i++) {
				IndexCatModel icm = list.get(i);
				getScore(listR, modelId, icm.getpId(), icm.getScore(), icm.getWeight(), icm.getType());
			}
		}

		return listR;
	}

	public void getScore(List<IndexCatModel> listICM, String modelId, String indexOrCatId, Double score, Double weight,
			String type) {
		IndexCatModel indexCatModel = evalInfoDao.getIndexCategoryModel(indexOrCatId, modelId).get(0);
		score = (score * weight) / 100;
		int mm = 0;
		for (int i = 0; i < listICM.size(); i++) {
			IndexCatModel icm = listICM.get(i);
			if (indexCatModel.getId().equals(icm.getId())) {
				mm += 1;
				icm.setScore(icm.getScore() + score);
				if (StringUtils.isNotBlank(type)) {
					if ("1".equals(type)) {
						icm.setScore1(icm.getScore1() + score);
					} else if ("2".equals(type)) {
						icm.setScore2(icm.getScore2() + score);
					} else if ("3".equals(type)) {
						icm.setScore3(icm.getScore3() + score);
					} else if ("4".equals(type)) {
						icm.setScore4(icm.getScore4() + score);
					} else if ("5".equals(type)) {
						icm.setScore5(icm.getScore5() + score);
					} else if ("6".equals(type)) {
						icm.setScore6(icm.getScore6() + score);
					}
				}
				break;
			}
		}
		if (mm == 0) {
			indexCatModel.setScore(score);
			if (StringUtils.isNotBlank(type)) {
				if ("1".equals(type)) {
					indexCatModel.setScore1(score);
				} else if ("2".equals(type)) {
					indexCatModel.setScore2(score);
				} else if ("3".equals(type)) {
					indexCatModel.setScore3(score);
				} else if ("4".equals(type)) {
					indexCatModel.setScore4(score);
				} else if ("5".equals(type)) {
					indexCatModel.setScore5(score);
				} else if ("6".equals(type)) {
					indexCatModel.setScore6(score);
				}
			}
			listICM.add(indexCatModel);
		}
		if (indexCatModel.getpId() == null || "".equals(indexCatModel.getpId()) || "0".equals(indexCatModel.getpId())) {
		} else {
			getScore(listICM, modelId, indexCatModel.getpId(), score, indexCatModel.getWeight(), type);
		}
	}

	@Override
	public List<Map> getScoreRank(Double score, String modelId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getScoreRank(score, modelId);
	}

	@Override
	public List<Map<String, Object>> getProcessList(String id) {
		// TODO Auto-generated method stub
		return evalInfoDao.getProcessList(id);
	}

	@Override
	public void deleteScoreByModelAndUser(String modelId, String evalId) {
		// TODO Auto-generated method stub
		evalInfoDao.deleteScoreByModelAndUser(modelId, evalId);
	}

	@Override
	public void updateEvalScoreAndRank(String id, Double score, String scoreRank, String evalInfo) {
		// TODO Auto-generated method stub
		evalInfoDao.updateEvalScoreAndRank(id, score, scoreRank, evalInfo);
	}

	@Override
	public String getEvalIdByModelAndUser(String modelId, String sqr) {
		// TODO Auto-generated method stub
		return evalInfoDao.getEvalIdByModelAndUser(modelId, sqr);
	}

	/*
	 * @Override public void preScore(List<Map> listIndexes, String userId,
	 * String modelId) { evalInfoDao.preScore(listIndexes,userId,modelId);
	 * 
	 * }
	 */

	@Override
	@Transactional
	public void preScore(String modelId, String sqr, String evalId) {
		List<IndexCatModel> list = evalInfoDao.getAllIndexAndValuesAndRules(evalId);
		evalInfoDao.deleteScoreByModelAndUser(modelId, evalId);
		List<IndexCatModel> listIndexes = new ArrayList<IndexCatModel>();
		double substration = 0;
		double add = 0;
		for (int i = 0; i < list.size(); i++) {
			IndexCatModel m = list.get(i);
			String type = m.getType();
			if (StringUtils.isNotBlank(type) && "2".equals(type)) {
				listIndexes.add(m);
				continue;
			}
			String value = m.getValue();
			if (value == null || "".equals(value)) {
				value = "0";
			}
			if (value.indexOf("%") > -1) {
				value = value.replaceAll("%", "");
				if (value == null || "".equals(value)) {
					value = "0";
				}
				if (!NumberUtils.isDecimal(value)) {
					throw new RuntimeException("指标【" + m.getName() + "】输入【" + m.getValue() + "】不符合规范，请输入合法的数字参与计算评分!");
				}
				value = String.valueOf(Double.valueOf(value) / 100);
			}
			if (!NumberUtils.isDecimal(value)) {
				throw new RuntimeException("指标【" + m.getName() + "】输入【" + m.getValue() + "】不符合规范，请输入合法的数字参与计算评分!");
			}
			String start = m.getStart();
			String end = m.getEnd();
			String inputType = m.getInputType();
			String dictSource = m.getDictSource();
			Double score = m.getScore();
			if (score == null || "".equals(score)) {
				score = 0.0;
			}
			if (StringUtils.isNotBlank(start) || StringUtils.isNotBlank(end)) {
				String formular = m.getFormular();
				if (formular != null && !"".equals(formular)) {
					float turnDataVal = 0;
					if (value.indexOf("%") > -1) {
						value = value.substring(0, value.indexOf("%"));
						turnDataVal = Float.valueOf(value) / 100;
					} else {
						turnDataVal = Float.valueOf(value);
					}
					String cc = MessageFormat.format(formular, String.valueOf(turnDataVal));
					score = Double.parseDouble(FormulaCalculator.getResult(cc));
				}
				if (StringUtils.isNotBlank(start) && StringUtils.isNotBlank(end)) {
					if (StringUtils.isNotBlank(inputType) && "2".equals(inputType)
							&& StringUtils.isNotBlank(dictSource)) {
						if (start.equals(value) && end.equals(value)) {
							listIndexes.add(list.get(i));
						}
					} else if (Double.parseDouble(value) >= Double.parseDouble(start)
							&& Double.parseDouble(value) < Double.parseDouble(end)) {
						listIndexes.add(list.get(i));
					}
				} else if (StringUtils.isNotBlank(start) && StringUtils.isBlank(end)) {
					if (Double.parseDouble(value) >= Double.parseDouble(start)) {
						listIndexes.add(list.get(i));
					}
				} else if (StringUtils.isBlank(start) && StringUtils.isNotBlank(end)) {
					if (Double.parseDouble(end) > Double.parseDouble(value)) {
						listIndexes.add(list.get(i));
					}
				}
				/*
				 * m.put(id, id); m.put(score, score);
				 */
			}

		}
		if (listIndexes == null) {
			listIndexes = new ArrayList<IndexCatModel>();
		}
		listIndexes.addAll(zzIndexes(evalId, sqr));
		if (listIndexes != null && listIndexes.size() > 0) {
			evalInfoDao.preScore(getAllListScore(listIndexes, sqr, modelId), sqr, modelId, evalId);
			/*
			 * if("2".equals(scoreType)){
			 * evalInfoDao.preScore(listIndexes,sqr,modelId); }else{
			 * evalInfoDao.preScore(getAllListScore(listIndexes,sqr,modelId),sqr
			 * ,modelId); }
			 */
			// evalInfoDao.preScore(listIndexes,sqr,modelId);
			/*
			 * double score2=getTotalScoreByType(sqr,modelId, "2");
			 * score2=NumberUtils.getDouble(2, score2); double
			 * score3=getTotalScoreByType(sqr,modelId, "3");
			 * score3=NumberUtils.getDouble(2, score3); double
			 * score4=getTotalScoreByType(sqr,modelId, "4");
			 * score4=NumberUtils.getDouble(2, score4); double
			 * score5=getTotalScoreByType(sqr,modelId, "5");
			 */
			Map<String, Object> scoreMap = getTotalScore(evalId);
			double score = (Double) (scoreMap.get("score"));
			double scoreAdd = evalInfoDao.getExtraScore(evalId, "add");
			double scoreSubtraction = evalInfoDao.getExtraScore(evalId, "subtraction");
			score = score + scoreAdd + scoreSubtraction;
			Map m = modelBaseService.selectOne(modelId);
			double rate = (double) m.get("rate");
			String scoreType = (String) m.get("scoreType");
			if (StringUtils.isNotBlank(scoreType) && "1".equals(scoreType) && rate != 0) {
				score = NumberUtils.getDouble(2, rate * score / 100);
				scoreAdd = NumberUtils.getDouble(2, rate * scoreAdd / 100);
				scoreSubtraction = NumberUtils.getDouble(2, rate * scoreSubtraction / 100);
			}
			List<Map> l = getScoreRank(score, modelId);
			String scoreRank = "";
			String evalInfo = "";
			if (l != null && l.size() > 0) {
				Map rank = l.get(0);
				scoreRank = String.valueOf(rank.get("name") == null ? "" : rank.get("name"));
				evalInfo = String.valueOf(rank.get("evalInfo") == null ? "" : rank.get("evalInfo"));
			}
			if (StringUtils.isBlank(evalId)) {
				evalId = getEvalIdByModelAndUser(modelId, sqr);
			}
			updateEvalScoreAndRank(evalId, score, scoreRank, evalInfo);
		}
	}

	public List<IndexCatModel> zzIndexes(String evalId, String userId) {
		List<IndexCatModel> list = evalInfoDao.getAllIndexAndValuesForZz(evalId);
		for (int i = 0; i < list.size(); i++) {
			IndexCatModel indexCatModel = list.get(i);
			List<Map> rulesSfyzz = modelBaseDao.getRuleListByIndexModelCatForZz(indexCatModel.getId(), "SFYZZ");
			List<Map> rulesZzsfdq = modelBaseDao.getRuleListByIndexModelCatForZz(indexCatModel.getId(), "ZZSFDQ");
			double score = 0;
			if (rulesSfyzz != null && rulesSfyzz.size() > 0) {
				long countSfyzz = cardsService.selectCardsSfyzz("", "", indexCatModel.getInputType(), userId, "");
				if (countSfyzz > 0) {
					for (int j = 0; j < rulesSfyzz.size(); j++) {
						if (rulesSfyzz.get(j).get("start").equals("1")) {
							score += Double.parseDouble(String.valueOf(rulesSfyzz.get(j).get("score")));
							break;
						}
					}
				} else {
					for (int j = 0; j < rulesSfyzz.size(); j++) {
						if (rulesSfyzz.get(j).get("start").equals("2")) {
							score += Double.parseDouble(String.valueOf(rulesSfyzz.get(j).get("score")));
							break;
						}
					}
				}
			}
			if (rulesZzsfdq != null && rulesZzsfdq.size() > 0) {
				long countZzsfdq = cardsService.selectCardsZzsfdq("", "", indexCatModel.getInputType(), userId, "");
				if (countZzsfdq > 0) {
					for (int j = 0; j < rulesZzsfdq.size(); j++) {
						if (rulesZzsfdq.get(j).get("start").equals("1")) {
							score += Double.parseDouble(String.valueOf(rulesZzsfdq.get(j).get("score")));
						}
					}
				} else {
					for (int j = 0; j < rulesZzsfdq.size(); j++) {
						if (rulesZzsfdq.get(j).get("start").equals("2")) {
							score += Double.parseDouble(String.valueOf(rulesZzsfdq.get(j).get("score")));
						}
					}
				}
			}
			if (rulesSfyzz != null && rulesSfyzz.size() > 0 && rulesZzsfdq != null && rulesZzsfdq.size() > 0) {
				score = score / 2;
			}
			indexCatModel.setScore(score);
		}
		return list;
	}

	@Override
	public Map<String, Object> getTotalScore(String evalId) {
		// TODO Auto-generated method stub
		return evalInfoDao.getTotalScore(evalId);
	}

	@Override
	public List<Map<String, String>> selectModelList(String orgName) {

		return evalInfoDao.selectModelList(orgName);
	}

	@Override
	public double getExtraScore(String evalId, String extra) {
		// TODO Auto-generated method stub
		return evalInfoDao.getExtraScore(evalId, extra);
	}

	@Override
	public int getAccountNum(String orgId) {

		return evalInfoDao.selectAccountNum(orgId);
	}

	@Override
	public int getPassedCheckNum(String orgId) {

		return evalInfoDao.selectPassedCheckNum(orgId);
	}

	@Override
	public int getProcessCheckNum(String orgId) {

		return evalInfoDao.selectProcessCheckNum(orgId);
	}

	@Override
	public Map<String, Object> getCheckGraphicStats(String orgId, String year) {

		Map<String, Object> data = new HashMap<String, Object>(2);

		List<Map<String, Object>> checking = evalInfoDao.selectCheckingGraphicStats(orgId, year + "-01", year + "-12");

		List<Map<String, Object>> checked = evalInfoDao.selectCheckedGraphicStats(orgId, year + "-01", year + "-12");

		data.put("checking", checking);
		data.put("checked", checked);
		return data;

	}

	@Override
	public Map<String, Object> getAccountGraphicStats(String orgId, String year) {
		Map<String, Object> data = new HashMap<String, Object>(2);

		List<Map<String, Object>> accounts = evalInfoDao.selectAccountGraphicStats(orgId, year + "-01", year + "-12");

		data.put("accounts", accounts);

		return data;

	}

	@Override
	public List<Map<String, String>> getEvalInfoByOrgId(String orgId) {

		return evalInfoDao.setEvalInfoByOrgId(orgId);
	}

	@Override
	public EvalInfo selectOne(String id) {
		// TODO Auto-generated method stub
		return evalInfoDao.selectOne(id);
	}

}
